package common;

import file.*;
import operator.ContextHandler;
import operator.Handler;
import operator.OUtil;
import resource.Resource;
import view.Main;
import view.ViewControl;

/**
 * Contains all singletons.
 * @author chai
 *
 */
public class Singleton {
    // Most Important components
    public static Main main() {
        return Main.main;
    }

    public static Handler handler() {
        return Handler.getHandler();
    }

    public static ViewControl vc() {
        return ViewControl.getViewControl();
    }

    public static ContextHandler contextHandler() {
        return ContextHandler.getContextHandler();
    }

    // Operators
    public static XDocOperator xDocOperator() {
        return XDocOperator.getOperator();
    }

    public static XlsOperator xlsOperator() {
        return XlsOperator.getOperator();
    }

    public static DocOperator docOperator() {
        return DocOperator.getOperator();
    }

    public static XMLOperator xmlOperator() {
        return XMLOperator.getOperator();
    }

    public static CfgOperator cfgOperator() {
        return CfgOperator.getOperator();
    }

    // Utils
    public static FUtil fUtil() {
        return FUtil.getUtil();
    }

    public static OUtil oUtil() {
        return OUtil.getUtil();
    }

    // Resource
    // Mainly, to avoid create this repeatedly while creating TinyButton
    public static Resource resource(){
        return Resource.getSource();
    }

}
